home *** CD-ROM | disk | FTP | other *** search
- <B>[PRODUCTION: This code goes with the second
- sidebar. -hth]<D>
-
- /*
- * Print BIOS equipment list from "int 0x11".
- * Written for Turbo C 2.0, by Bob Bybee, 9/91.
- *
- * Bit 1 is set if the BIOS thinks there's an 80x87
- * installed, clear if not. See any BIOS book for
- * detailed descriptions of the other bits. Not all
- * BIOS versions use these bits in the same ways.
- */
- #include <stdio.h>
- #include <dos.h>
-
- void main( void )
- {
- union REGS regs;
- unsigned int ef; /* equipment flags */
-
- int86(0x11, ®s, ®s); /* ask BIOS for it */
- ef = regs.x.ax; /* copy the AX value */
-
- printf("Selected BIOS equipment flags from INT 0x11:\n");
- printf(" math coprocessor: %u\n", (ef >> 1) & 1);
- printf(" initial video mode: %u\n", (ef >> 4) & 3);
- printf("# of diskette_drives: %u\n", ((ef >> 6) & 3) + 1);
- printf(" # of com ports: %u\n", (ef >> 9) & 7);
- printf(" # of lpt ports: %u\n", (ef >> 14) & 3);
- }